// DlgShowStressNumber.cpp : implementation file
//

#include "stdafx.h"
#include "pdarx.h"
#include "DlgShowStressNumber.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgShowStressNumber dialog


CDlgShowStressNumber::CDlgShowStressNumber(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgShowStressNumber::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgShowStressNumber)
	m_strNumber = _T("");
	m_strAllocate = _T("");
	//}}AFX_DATA_INIT
	::AfxSetResourceHandle(g_ARXInstance);

}


void CDlgShowStressNumber::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgShowStressNumber)
	DDX_Text(pDX, IDC_EDIT_NUMBER, m_strNumber);
	DDX_Text(pDX, IDC_STATIC_ALLOCATE, m_strAllocate);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgShowStressNumber, CDialog)
	//{{AFX_MSG_MAP(CDlgShowStressNumber)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////




int CDlgShowStressNumber::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	::AfxSetResourceHandle(g_CADInstance);

	return 0;
}

BOOL CDlgShowStressNumber::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CRect rc;
	this->GetWindowRect(&rc);
	int nWidth = rc.Width();
	int nHeight = rc.Height();   
	int x = pt.x - nWidth/2;
	int y = pt.y - nHeight;
    if( x < 0 )
	{
		x = 0;
	}
	int smx = GetSystemMetrics(SM_CXSCREEN);
	if( (x + nWidth) > smx )
	{
		x = smx - nWidth;
	}
	if( y < 0 )
	{
		y = 0 ;
	}
	int smy = GetSystemMetrics(SM_CYSCREEN);
	if( ( y + nHeight) > smy)
	{
		y = smy - nHeight;
	}
	this->MoveWindow(x , y, nWidth, nHeight);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
